cross language & cross platform
2024-12-03
pixi to recreate the exact same environment anywhere (quickly)pixi and quarto.devcontainer and .github configuration filesthis is a template repository; you can run it as-is to get a feel for the workflow, or clone and edit for your needs
go somewhere on your computer you keep your projects, then clone (or fork then clone to run from your own copy)
cd projectsgit clone https://github.com/knaaptime/rypyrx.gitTo open this repository exactly as it appears, just click the button
if you want to start a github codespace from another project (like if you forked your own version of this repo)
click ‘reopen in container’
if you need to add/change dependencies, edit the pixi.toml file
notebooks directoryI like jupyter notebooks for doing my main analysis
pixi.toml file includes both Python and R kernels
install.packages, but you won’t have the lockfile for those packages…cd notebookspixi run jupyter labuse quarto to manage file execution order and generate outputs
paper directorythis directory stores a standalone quarto project
_quarto.yml file to include any pieces you need executedincludes to wrap them togetherI use a single index.qmd file as the main source document, then include each section as a different file
cd paperpixi run quarto renderthe output will be rendered to the default location at paper/_manuscript/
configure any preferences in the _quarto.yml file. Mine are
index.html to make it easier to serveThere is a preconfigured github-action recipe in the .github directory that will serve a static website from the slides directory
(edit the names if you like, but i usually have slides to publish). Anything in this directory will be served, so you can also toss your paper in pdf/html in here when it’s ready for the public
one small config:
pages settingsuse github actions
the config file is already setup. You’re done.
the slides directory is another standalone quarto project
cd slidespixi run quarto rendercommit everything you want public in slides, then push it up.
cd slidesgit add .git commit -m 'add slides'git pusheverything will be available at https://{{yourgithubname}}.github.io/{{yourprojectname}}
use quarto extensions to make this look nice.
Elijah Knaap, Center for Open Geographical Science @ SDSU